package _0_语法._3_分支;

import java.util.Scanner;

public class _2_根据输入的x值_输出y1 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x;
        int y;

        System.out.println("请输入一个整数：");
        x = scanner.nextInt();

        if(x < 0){
            y = -1;
        }
        else {
            if(x == 0){
                y = 0;
            }
            else {
                y = 1;
            }
        }
        System.out.println("y = " + y);
    }
}
